package com.gdcp.mapper;

import com.gdcp.beans.Shop;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface ShopMapper {
    List<Shop> findPageBreakByCondition(Map<String, Object> model);

    int insert(Shop shop);

    void updateByShopId(Shop shop);

    List<Shop> queryShopInfoByShopId(@Param("shop_id") Integer shop_id,@Param("user_id") Integer user_id);

    List<Shop> queryByNewTime();

    //销量
    int updateSaleCount(@Param("id") Integer id);

    //浏览量
    int updatePopularity(@Param("id") Integer id);

    int removeByPrimaryKey(Integer id);

    //int register(Shop shop);

    void updateShopId(Shop shop);

    Shop queryInfoById(Integer id);

    List<Shop> searchInformation(Map<String, Object> model);

    List<Shop> getPageNumber(Integer cid);

    List<Shop> searchByShop(@Param(value = "category_id") Integer cid, @Param(value = "pc") int pc, @Param(value = "ps") int ps, @Param(value = "search_key") String search_key, @Param(value = "column") String keyword, @Param(value = "sort") String sort);

    List<Shop> queryByAll();

    void registerShop(Shop shop);
}
